package main

import (
	"github.com/olivere/elastic/v7"
	"luiz/crawler_distributed/persist"
	"luiz/crawler_distributed/prcsupport"
)

type Echo int

func (t *Echo) Hi(args string, reply *string) error {
	*reply = "echo:" + args
	return nil
}

func main() {

	//err := prcsupport.ServeRpc("127.0.0.1:1111", rpcdemo.DemoService{})
	//
	client, _ := elastic.NewClient(elastic.SetURL("http://124.71.171.6:9200/"))
	err := prcsupport.ServeRpc(":1111", &persist.ItemSaverService{Client: client})
	if err != nil {
		panic(err)
	}

}
